﻿using System;

namespace AEM.Data.BLL.Actions
{
    public static class ClientConfig
    {
        static ClientConfig()
        {
            AddClientConfig = doAddClientConfig;
        }
        private static AddConfigRusult doAddClientConfig(Model.ClientConfig row)
        {
            Model.ClientConfig model = DAL.ClientConfig.Search();

            if (null != model)
            {
                model.Address = row.Address;
                model.ClientName = row.ClientName;
                model.Leader = row.Leader;
                model.Phone = row.Phone;
                model.LeadersPhone = row.LeadersPhone;
                DAL.ClientConfig.Update(model);
            }
            else
            {
                DAL.ClientConfig.Add(row);
            }
            return AddConfigRusult.OK;
        }

        public static Func<Model.ClientConfig, AddConfigRusult> AddClientConfig;

        public enum AddConfigRusult
        {
            OK
        }

    }
}
